import requests
dic = {'q': 'crawler'}

r = requests.request('GET', 'https://api.github.com/search/repositories', params=dic)
print(r.url)
content = {'q': 'crawler', 'per_page': '5'}

r = requests.get('https://api.github.com/search/repositories', params=content)
print(r.url)

content= {'id':'crawler' ,'pwd':'123'}

r=requests.post('http://www.xxx/api/login.aspx',data=content)
r = requests.head("http://www.baidu.com/")

print(r.headers)
req = requests.get('https://www.baidu.com')

print(req.status_code)
print(req.encoding)
print(req.text)
print(req.content)